﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using LP580.CG;

public partial class GiftClass : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            StringBuilder sb = new StringBuilder();
            StringBuilder sb2 = new StringBuilder();
            sb.Append(@"<table width='990' border='0' cellpadding='0' cellspacing='0' class='mtop10'><tr>
    <td align='center' valign='middle' class='alllistbg'><table width='960' border='0' cellspacing='0' cellpadding='0'>
      <tr>
        <td width='89' align='left' class='dianmp_title'>礼品目录</td>
        <td width='871' valign='middle' class='allfenlei'>");
            int j = 1;
            List<clsGiftProductClass> ls = clsGiftProductClass.GetCollection();
            foreach (clsGiftProductClass cls in ls)
            {
                if (cls.GiftProductClassCode.Length == 4)
                {
                    if (j != 1)
                    {
                        sb2.Remove(sb2.Length - 1, 1);
                        sb2.Append("</td></tr></table>");
                    }
                    sb2.Append("<table width='100%' border='0' cellspacing='0' cellpadding='0' class='allbottom10'><tr>");
                    sb2.Append("<td width='2%' align='center' class='allline'><img src='images/sjx.gif' width='9' height='13'></td>");
                    sb2.AppendFormat("<td width='98%' align='left' valign='bottom' class='allline allbigleititle'><a name='c{1}'>{0}</a></td>", cls.GiftProductClassName, j);
                    sb2.Append("</tr><tr><td>&nbsp;</td><td class='allsmalllei'>");
                    sb.AppendFormat("<a href='#c{1}'>{0}</a> ", cls.GiftProductClassName, j);
                    j++;
                }
                else if (cls.GiftProductClassCode.Length == 12)
                {
                    sb2.AppendFormat("<a href='{0}'>{1}</a>|", cls.GiftProductClassID, cls.GiftProductClassName);
                }
            }

            sb.Append("</td></tr></table></td></tr><tr><td class='allbg'>");

            sb2.Append("</td></tr></table>");
            sb.Append(sb2);
            sb.Append("</td></tr></table>");
            Literal1.Text = sb.ToString();
        }
    }
}